package org.anti996.lms.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class TransportOutput {
    private Transport transport;

    private Truck truck;

    private Driver driver;

    private Warehouse wFrom;

    private Warehouse wTo;

    private TransportStatus status;

    public static TransportStatus calculateStatus(TransportOutput output) {
        if (output.transport.getArrive() != null) {
            return TransportStatus.ARRIVE;
        } else if (output.transport.getDepart() != null) {
            return TransportStatus.DEPART;
        } else {
            return TransportStatus.CREATED;
        }
    }
}
